package com.jiuzhou.services.base.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;

import com.jiuzhou.crawler.base.mapper.BaseDao;
import com.jiuzhou.crawler.taobao.mapper.KeyWordsDao;
import com.jiuzhou.services.base.IBaseService;


	/**
	 * 项目名称：大数据爬虫
	 * @author yanganzhen
	 * version-code：1.0
     * 类说明：数据库业务逻辑通用类--用于实现每个模块通用数据库操作方法
     * 创建时间：2016年12月27日
	 * @param <T>
	 */
public class BaseServiceImpl<T> implements IBaseService<T> {

	@Autowired
	BaseDao<T>  baseMapper; 
	
	@Override
	public List<Map<String,Object>> getSelectAll() {
		List<Map<String,Object>> resultList = baseMapper.getSelectAllMapper();
		return resultList;
	}

	@Override
	public Map<String,Object> getById(String id) {
		Map<String,Object> resultMap = baseMapper.getByIdMapper(id);
		return resultMap;
	}

	@Override
	public List<Map<String,Object>> getByParameter(Map<String,Object> param) {
		List<Map<String,Object>> resultList = baseMapper.getByParameterMapper(param);
		return resultList;
	}

	@Override
	public int insert(T t) {
		int excuteNum  = baseMapper.insertMapper(t);
		return excuteNum;
	}

	@Override
	public int update(Map<String, Object> param) {
	int  excuteNum = baseMapper.updateMapper(param);
		return excuteNum;
	}

	@Override
	public int delete(Map<String, Object> param) {
		int  excuteNum = baseMapper.deleteMapper(param);
		return excuteNum;
	}

}
